<?php
session_start();
define('APP_ID', 'Facebook APP ID');
define('APP_SECRET', 'Facebook Secret ID');
define('YOUR_CONSUMER_KEY', 'Twitter Key');
define('YOUR_CONSUMER_SECRET', 'Twitter Secret Key');
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'User Name');
define('DB_PASSWORD', 'Password');
define('DB_DATABASE', 'DATABASE');
$connection = mysql_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD) or die(mysql_error());
$database = mysql_select_db(DB_DATABASE) or die(mysql_error());

if (isset($_SESSION['id'])) {
// Redirection to login page twitter or facebook
header("location: twitterlogin2.php");
}
if (array_key_exists("login", $_GET))
{
$oauth_provider = $_GET['oauth_provider'];
if ($oauth_provider == 'twitter')
{
header("Location: login-twitter.php");
}
else if ($oauth_provider == 'facebook')
 {
header("Location: login-facebook.php");
}
}
?>
//HTML Code
<a href="?login&oauth_provider=twitter">Twitter_Login</a>
<a href="?login&oauth_provider=facebook">Facebook_Login</a>
<!--Consumer key     VzbQfui0TnV7QR0VNpU2Q
Consumer secret     ijF2ZxiwXr0V1KtJvj5bSU3SWzEwThHJi6tMSwlJNFk
Request token URL     https://api.twitter.com/oauth/request_token
Authorize URL     https://api.twitter.com/oauth/authorize
Access token URL     https://api.twitter.com/oauth/access_token
Callback URL     None-->


<!--Access token     259658800-wfYjek7899UBDRDT0FUEF1RmbLJigj9OJoZ1vbgp
Access token secret     PNckHWEdtIHui53lYnf5GtMz84srtrldLMjb7Gew
Access level     Read-only-->
